<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link href="__PUBLIC__/Css/Admin/Bootstrap/bootstrap.min.css" rel="stylesheet"  >
<link href="__PUBLIC__/Js/jqui/jquery-ui.min.css" rel="stylesheet"  >
<script src='__PUBLIC__/Js/jquery-3.1.0.min.js'></script>
<script src='__PUBLIC__/Js/jqPaginator.js'></script>
<script src='__PUBLIC__/Js/jqui/jquery-ui.min.js'></script>
<body>
	
	<table class='table table-bordered'>
	<thead>
		<tr><td colspan=7>当前位置:评论管理>>商品评论管理&nbsp;&nbsp;<div id='msg' class="btn btn-warning" style="display:none;position:fixed;margin-left:500px;margin-top:-10px;"></div>
</td></tr>
		<tr>
		 <td>编号</td>
		 <td>商品名称</td>
		 <td>用户名</td>
		 <td>评论内容</td>
		 <td>评论时间</td>
		 <td>审核状态</td>
		 <td>操作</td>
	   </tr> 
	  </thead>
       <volist name='comments' id='vo'>
       	<tbody>
       	<tr>
		<td><{$vo.id}></td>
		<td><{$vo.goods_name}></td>
		<td>
			<if condition='$vo.user_name eq rose'>管理员
			<else/> <{$vo.user_name}>
			</if>
		 </td>
		<td><{$vo.content}></td>
		<td><{$vo.add_time|date="Y-m-d  H:i:s",###}></td>
		<td><if condition='$vo.check eq 1'>
			<font size='4' color='green'><b>已审核</b></font>
			 <else/>
			 <font size='4' color='red'><b>未审核</b></font>
			 </if>
		</td>
		<td>
			<button type='button' name='but_pass' data-id='<{$vo.id}>'  class='btn btn-primary'>
				通过</button>
				<button type='button' name='but_del' data-del='<{$vo.id}>' class='btn btn-primary'>
		    	删除</button>
	
			</td>
	   </tr> 
	   </tbody>
       </volist> 
    </table>
	<script>
		$(function(){
			$("[name='but_pass']").click(function(){
				var  id=$(this).attr('data-id');
				$.get("<{:U('dopass')}>",{id:id},function(data){
					if(data.status==1){
					  $('#msg').text(data.msg);
					  $('#msg').css('display','block');
				      setTimeout(function(){$('#msg').fadeOut('slow');},2000);
					  location.reload();
					}else{
						$('#msg').text(data.msg);  
					  $('#msg').css('display','block');
				      setTimeout(function(){$('#msg').fadeOut('slow');},2000);
					}
				},'json');
			});
				$("[name='but_del']").click(function(){
				var  id=$(this).attr('data-del');
				$.get("<{:U('delcomment')}>",{id:id},function(data){
					if(data.status==1){
					  $('#msg').text(data.msg);  
					  $('#msg').css('display','block');
				      setTimeout(function(){$('#msg').fadeOut('slow');},2000);
					  location.reload();
					}else{
					  $('#msg').text(data.msg);  
					  $('#msg').css('display','block');
				      setTimeout(function(){$('#msg').fadeOut('slow');},2000);
					}
				},'json');
			});
			
			
			
		});
		
	
		
	</script>
</body>
</html>